home *** CD-ROM | disk | FTP | other *** search
/ Aminet 37 / Aminet 37 (2000)(Schatztruhe)[!][Jun 2000].iso / Aminet / dev / src / emog.lha / parser.e < prev    next >
Encoding:
Text File  |  2000-03-07  |  2.0 KB  |  64 lines

  1. /* -- ----------------------------------------------------- -- *
  2.  * -- Name........: parser.e                                -- *
  3.  * -- Description.: Simple module which uses the automatic  -- *
  4.  * --               generated parser by EYACC .             -- *
  5.  * -- Author......: Daniel Kasmeroglu                       -- *
  6.  * -- E-Mail......: raptor@cs.tu-berlin.de                  -- *
  7.  * --               daniel.kasmeroglu@daimlerchrysler.com   -- *
  8.  * -- Date........: 05-Mar-00                               -- *
  9.  * -- Version.....: 0.1                                     -- *
  10.  * -- ----------------------------------------------------- -- */
  11.  
  12. /* -- ----------------------------------------------------- -- *
  13.  * --                          Options                      -- *
  14.  * -- ----------------------------------------------------- -- */
  15.  
  16. OPT MODULE
  17.  
  18.  
  19. /* -- ----------------------------------------------------- -- *
  20.  * --                          Modules                      -- *
  21.  * -- ----------------------------------------------------- -- */
  22.  
  23. MODULE  '*yyparse'
  24.  
  25.  
  26. /* -- ----------------------------------------------------- -- *
  27.  * --                        Declarations                   -- *
  28.  * -- ----------------------------------------------------- -- */
  29.  
  30. EXPORT DEF glinput
  31. EXPORT DEF result
  32.  
  33.  
  34. /* -- ----------------------------------------------------- -- *
  35.  * --                         Functions                     -- *
  36.  * -- ----------------------------------------------------- -- */
  37.  
  38. ->> PROC parse()
  39. ->
  40. -> SPEC   parse( tokenfile )
  41. -> DESC   Parses the C-Header which was splitted
  42. ->        before in tokens.
  43. -> PRE    {tokenfile} : File generated by the scanning part.
  44. -> POST   true
  45. ->
  46. EXPORT PROC parse( par_scanned ) HANDLE
  47. DEF par_res
  48.  
  49.   glinput := Open( par_scanned, OLDFILE )
  50.   IF glinput = NIL THEN Raise( "PARS" )
  51.  
  52.   WriteF( 'Parsing...\n' )
  53.   par_res := yyparse()
  54.  
  55.   IF par_res <> 0 THEN Raise( "PARS" )
  56.  
  57. EXCEPT DO
  58.   IF glinput   <> NIL THEN Close( glinput   )
  59.   IF exception <> 0   THEN Raise( exception )
  60. ENDPROC result
  61. -><
  62.  
  63.  
  64.